<?php

	class TimeUtil{
		
		public static function isAnotherWeek(){
			if(date('N', time()) == 1)
				return true;
			return false;
		}
		
		public static function isAnotherMonth(){
			if(date('j', time()) == 1)
				return true;
			return false;
		}
		
		public static function getStartAndEndDate($week, $year) {
			$time = strtotime("1 January $year", time());
			$day = date('w', $time);
			$time += ((7*$week)-$day)*24*3600;
			$return['start'] = date('Y-m-d', $time);
			$time += 6*24*3600;
			$return['end'] = date('Y-m-d', $time);
			
			return $return;
		}
		
	}